package study.spring;

import lombok.SneakyThrows;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import study.spring.pojo.Hello;

import java.io.File;
import java.io.FileReader;

@ImportResource("beans.xml")
public class Main {
    @SneakyThrows
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("src/main/resources/beans.xml");
        Hello hello = context.getBean(Hello.class);
        System.out.println(hello);
//        File file = new File("src/main/resources/beans.xml");
//        FileReader reader = new FileReader(file);
//        System.out.println(reader.read());
    }
}
